libxl: ocaml: event management
authorRob Hoes <rob.hoes@citrix.com>
Tue, 10 Dec 2013 16:48:27 +0000 (16:48 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 11 Dec 2013 13:17:38 +0000 (13:17 +0000)
commitfd8c37da4e75e92eb2b38283ab0cab1018de2feb
treef3d88e5dd2c9a9b83525b373558c99483be5e3da
parent00d46451e3751404a4f4fe243315bf0c7e4f3280
libxl: ocaml: event management

Having bindings to the low-level functions libxl_osevent_register_hooks and
related, allows to run an event loop in OCaml; either one we write ourselves,
or one that is available elsewhere.

The Lwt cooperative threads library (http://ocsigen.org/lwt/), which is quite
popular these days, has an event loop that can be easily extended to poll any
additional fds that we get from libxl. Lwt provides a "lightweight" threading
model, which does not let you run any other (POSIX) threads in your
application, and therefore excludes an event loop implemented in the C
bindings.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Acked-by: David Scott <dave.scott@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/ocaml/libs/xl/xenlight.ml.in
tools/ocaml/libs/xl/xenlight.mli.in
tools/ocaml/libs/xl/xenlight_stubs.c